package com.sale.succ.forms;

import com.sale.succ.components.DefForm;
import com.sale.succ.utils.TraderConstants;
import com.sale.succ.utils.TraderHelper;

import eve.fx.gui.WindowConstants;
import eve.ui.CellPanel;
import eve.ui.ScrollableHolder;
import eve.ui.TextPad;
import eve.ui.VerticalScrollPanel;

public class HelpForm extends DefForm {
	private CellPanel dataPanel;
	private TextPad textPad;
	
	public HelpForm(){
		title = TraderHelper.getLabel(TraderConstants.HELP_LABEL);
		addLast(getDataPanel());
		doButtons(CANCELB);
		windowFlagsToSet |= WindowConstants.FLAG_MAXIMIZE;
	}
	
	protected CellPanel getDataPanel(){
		if (dataPanel == null) {
			dataPanel = new CellPanel();
			VerticalScrollPanel vsp = new VerticalScrollPanel(new ScrollableHolder(dataPanel));
			addLast(vsp);
			textPad = new TextPad(TraderHelper.getLabel(TraderConstants.DEVELOPERS));			
			textPad.setControl(HCENTER);
			textPad.setAsStaticDisplay(true);
			textPad.disableCursor = true;
			textPad.disableTextChanges = true;
			textPad.setBorder(TextPad.BDR_DOTTED, 0);
			addLast(textPad);
			dataPanel.backGround = TraderConstants.BUTTON_BGR;
		}
		return dataPanel;
	}
	
	public boolean handleAction(String action) {
		return super.handleAction(action);
	}
}
